/*
ID: guoxu1
PROG: money
LANG: C++
*/
#include <fstream>
#include <vector>
using namespace std;

#define cin fin
#define cout fout

int main()
{
  ifstream fin( "money.in" );
  ofstream fout( "money.out" );

  int coinCount = 0;
  int amount = 0;

  cin >> coinCount >> amount;
  vector<unsigned long long> F( amount + 1, 0 );
  vector<int> Coins( coinCount, 0 );
  F[0] = 1;

  for( int i = 0; i < coinCount; i++ )
  {
    cin >> Coins[i];
  }

  for( int i = 0; i < coinCount; i++ )
  {
    for( int j = 0; j < amount; j++ )
    {
      if( j + Coins[i] > amount ) continue;
      F[j + Coins[i]] += F[j];
    }
  }

  cout << F[amount] << endl;
  return 0;
}
